<template>
  <div class="battle-skin-item">
    <div class="skin-item-image">
      <img :src="skinTemplate" />
      <img :src="award.skin_img" />
    </div>

    <div class="skin-item-title text-overflow">{{ award.skin_name }}</div>
    <div class="skin-item-price">
      <img src="@/static/img/battle/diamond.png" />
      {{ award.skin_price }}
    </div>
  </div>
</template>
<script lang="ts">
import { defineComponent, PropType } from "vue";
import type { BattleAward } from "../services";
import skinTemplate from "@/static/img/battle/skin-template.png";

export default defineComponent({
  data() {
    return {
      skinTemplate,
    };
  },

  props: {
    award: {
      type: Object as PropType<BattleAward>,
      default: () => ({}),
    },
  },
});
</script>

<style scope lang="scss">
.battle-skin-item {
  padding-top: 10px;
  padding-bottom: 12px;
  text-align: center;
  background: #28253b;

  .skin-item-image {
    margin: 0 19px;
    position: relative;

    img:first-child {
      width: 100%;
      opacity: 0;
    }

    img:last-child {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
    }
  }

  .skin-item-title {
    margin-top: 20px;
    padding: 0 5px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
  }

  .skin-item-price {
    color: rgba(255, 255, 255, 0.6);
    margin-top: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;

    img {
      width: 20px;
      margin-right: 6px;
    }
  }
}
</style>

<style scoped lang="scss">
@media screen and (max-width: 600px) {
  .skin-item-price {
    font-size: 12px;

    img {
      width: 16px;
      margin-right: 6px;
    }
  }
}
</style>
